package com.coolw.dynamic.thread.pool.context;

import com.coolw.common.api.BaseDomain;
import com.coolw.dynamic.thread.pool.enums.KeepAliveTimeUnitEnum;
import com.coolw.dynamic.thread.pool.enums.QueueTypeEnum;
import com.coolw.dynamic.thread.pool.enums.RejectedExecutionHandlerEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 线程池配置属性
 *
 * @author coolw
 * @date 2024/5/15 16:21
 */
@Getter
@Setter
public class ThreadPoolProperties extends BaseDomain {
    private static final long serialVersionUID = 5013190866188188517L;

    /**
     * 线程池编码
     */
    private String poolCode;

    /**
     * 核心线程数
     */
    private Integer corePoolSize;

    /**
     * 最大线程数
     */
    private Integer maxPoolSize;

    /**
     * 线程存活时间
     */
    private Long keepAliveTime;

    /**
     * 线程存活时间单位 {@link KeepAliveTimeUnitEnum}
     */
    private String keepAliveTimeUnit;

    /**
     * 队列类型 {@link QueueTypeEnum}
     */
    private String queueType;

    /**
     * 队列大小
     */
    private Integer queueSize;

    /**
     * 拒绝策略 {@link RejectedExecutionHandlerEnum}
     */
    private String rejectStrategy;
}